#!/bin/bash
logfil="/Library/Logs/SCT/sct_install_`date +%Y%m%d`.log"

echo "----------------- unpkg Installation Start -----------------" >> $logfil
if [ ! -r "$HOME/Desktop/Tools" ];
then
	mkdir "$HOME/Desktop/Tools"
	echo "$(date +%T): tools dir didn't exist, created one" >> $logfil
	chown "$USER" "$HOME/Desktop/Tools"
	echo "$(date +%T): owner set to $USER" >> $logfil
fi
unzip "${3}/tmp/App/unpkg.zip" -d "${3}/tmp/App/"
echo "$(date +%T): unzipped unpkg, now copying it to tools" >> $logfil
cp -Rf "${3}/tmp/App/unpkg.app" "$HOME/Desktop/Tools/"

echo "------------------ unpkg Installation End ------------------" >> $logfil
echo "" >> $logfil	